import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CommentEntity } from './entities/comment.entity';
import { PostEntity } from 'src/post/entities/post.entity'; // ✅ 引入 PostEntity

import { CommentService } from './comment.service';
import { CommentController } from './comment.controller';

@Module({
  imports: [
    TypeOrmModule.forFeature([CommentEntity, PostEntity]) // ✅ 添加 PostEntity
  ],
  controllers: [CommentController],
  providers: [CommentService],
  exports: [CommentService], // 如果别的模块也要用 CommentService，必须导出
})
export class CommentModule {}
